package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.Bank;
import com.acme.bankapp.domain.bank.Client;

public class BankService {
	private static final String BALANCE = "Balance: ";
	private static final String MAX_AMOUNT_TO_WITHDRAW = "Maximum amount to withdraw: ";
	public static void addClient(Bank bank, Client client) {
		bank.addClient(client);
	}

	public static void printMaximumAmountToWithdraw(Bank bank) {
		System.out.println(MAX_AMOUNT_TO_WITHDRAW);
		for (Client client : bank.getClients()) {
			System.out.println(client.getClientSalutation() + " "
					+ client.getAccount().maximumAmountTowothdraw());
		}
		System.out.println();
	}

	public static void modifyBank(Bank bank) {
		bank.getClients()[0].getAccount().deposit(50);
		bank.getClients()[1].getAccount().withdraw(500);
	}

	public static void printBalance(Bank bank) {
		System.out.println(BALANCE);
		for (Client client : bank.getClients()) {
			System.out.println(client.getClientSalutation() + " "
					+ client.getAccount().getBalance());
		}
		System.out.println();
	}
}
